﻿using System;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MarkdownMonster.RenderExtensions
{
    /// <summary>
    /// Interface implemented for RenderExtensions that modify
    /// </summary>
    public interface IRenderExtension
    {
        /// <summary>
        /// Method that is fired on the inbound pass before the document is rendered and that
        /// allows you to modify the *markdown* before it is sent out for rendering.
        /// </summary>
        /// <param name="markdown"></param>
        /// <param name="document"></param>
        void BeforeRender(ref string markdown, MarkdownDocument document);


        /// <summary>
        /// Fired after the document has been rendered to HTML to allow you add
        /// a custom HTML header to the document when generating file output
        /// rendered through the Preview template.
        ///
        /// Return null to do nothing, or any extra `header` content that is
        /// embedded inside of the HTML document's Head section.
        /// </summary>
        /// <param name="html"></param>
        /// <param name="markdown"></param>
        /// <returns></returns>
        string RenderHeader(string html, string markdown, MarkdownDocument document);


        /// <summary>
        /// Fired after Markdown has been converted to HTML and allows you to modify
        /// the rendered HTML fragment generated by the markdown. Note that this
        /// method can only change the rendered Markdown html, not the entire document.
        ///
        /// You can change the passed in Html reference to make a change to the document.
        /// </summary>
        /// <param name="html">Passed by ref to signify that you can mutate the HTML to be rendered</param>
        /// <param name="markdown">original markdown conent passed in for reference</param>
        void InsertContent(ref string html, string markdown, MarkdownDocument document);

        

    }
}
